<?php
/**
 * SocialEngine
 *
 * @category   Application_Core
 * @package    User
* @version    $Id: index.tpl 7244 2010-09-01 01:49:53Z john $
 * @author     John
 */
?>
<?php 
$user_online_options = include('application/settings/database.php');
mysql_connect($user_online_options['params']['host'],$user_online_options['params']['username'],$user_online_options['params']['password']);
mysql_select_db($user_online_options['params']['dbname']);
$user_online_query = mysql_query("SELECT * FROM engine4_user_online WHERE user_id=" . $this->subject()->user_id);
$user_is_online = mysql_num_rows($user_online_query);
?>



<div id='profile_status'>
  <h2>
    <?php echo $this->subject()->getTitle(); ?> 
        <?php if($user_is_online) echo('<img src="online.png" alt="Online" />');  ?>     
  </h2>
  <?php if( $this->auth ): ?>
    <span class="profile_status_text" id="user_profile_status_container">
      <?php echo $this->viewMore($this->subject()->status) ?>
      <?php if( !empty($this->subject()->status) && $this->subject()->isSelf($this->viewer())): ?>
        <a class="profile_status_clear" href="javascript:void(0);" onclick="en4.user.clearStatus();">(<?php echo $this->translate('clear') ?>)</a>
      <?php endif; ?>
    </span>
  <?php endif; ?>
</div>


<?php if( !$this->auth ): ?>
  <div class="tip">
    <span>
      <?php echo $this->translate('This profile is private - only friends of this member may view it.');?>
    </span>
  </div>
  <br />
<?php endif; ?>